package com.sti.framework.models.Aps.data;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sti.framework.core.data.AbstractAuditingEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
import java.util.Map;


/**
 * @author dj
 */
@Data
@Accessors(chain = true)
@TableName("aps_month_plan_mo")
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "aps_model_info", description = "模具数据")
public class ApsMonthPlanMo extends AbstractAuditingEntity {

    /**
     * 属性代号
     */
    @TableField(value = "product_code")
    private String productCode;

    /**
     * 厂家
     */
    @TableField(value = "customer_name")
    private String customerName;

    /**
     * 交付日
     */
    @TableField(value = "date_delivery")
    private String dateDelivery;

    /**
     * 产品说明
     */
    @TableField(value = "delivery_remarks")
    private String deliveryRemarks;

    /**
     * 产品
     */
    @TableField(value = "product_type_name")
    private String productTypeName;

    /**
     * 材质
     */
    @TableField(value = "material_name")
    private String materialName;

    /**
     * 单重(吨)
     */
    @TableField(value = "weight")
    private BigDecimal weight;

    /**
     * 支数
     */
    @TableField(value = "product_count")
    private Long productCount;

    /**
     * 已排
     */
    @TableField(value = "cast_cnt")
    private Long castCnt;

    /**
     * 待排
     */
    @TableField(value = "wait_cnt")
    private Long waitCnt;

    /**
     * 完成日期
     */
    @TableField(value = "date_complete")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate dateComplete;

    /**
     * 排程异常
     */
    @TableField(value = "execute_exception")
    private String executeException;

    /**
     * 基础数据异常
     */
    @TableField(value = "base_data_exception")
    private String baseDataException;

    /**
     * 排程排上投产日来源或者理由
     */
    @TableField(value = "schedul_source")
    private String schedulSource;

    /**
     * 优先级 1为最急，2为次急，3为常规
     */
    @TableField(value = "priority_value")
    private Integer priorityValue;

    /**
     * 模具列表hyl
     */
    @TableField(value = "model_list")
    private String modelList;

    /**
     * 工艺尺寸hyl
     */
    @TableField(value = "workmanship_spec")
    private String workmanshipSpec;

    /**
     * 模具CODE hyl
     */
    @TableField(value = "model_code")
    private String modelCode;

    /**
     * 首件标识 0 非首件   1 是首件
     */
    @TableField(value = "product_first_flag")
    private Long productFirstFlag;

    /**
     * 投产使用模具code列表
     */
    @TableField(value = "use_model_list")
    private String useModelList;

    /**
     * 模具直径与长度
     */
    @TableField(value = "model_spec")
    private String modelSpec;

    /**
     * 订单编号
     */
    @TableField(value = "order_info_code")
    private String orderInfoCode;

    /**
     * 产品直径
     */
    @TableField(value = "diameter")
    private String diameter;

    /**
     * 产品长度
     */
    @TableField(value = "length")
    private BigDecimal length;

    /**
     * 工艺尺寸直径
     */
    @TableField(value = "workmanship_diameter")
    private String workmanshipDiameter;

    /**
     * 工艺尺寸长度
     */
    @TableField(value = "workmanship_length")
    private BigDecimal workmanshipLength;

    /**
     * 工作层
     */
    @TableField(value = "work_layer")
    private String workLayer;

    /**
     * 材质对应的code_com
     */
    @TableField(value = "material_code_com")
    private String materialCodeCom;

    /**
     * 硬度(包含最小值、最大值、单位)
     */
    @TableField(value = "hardness")
    private String hardness;

    /**
     * 铸造类型
     */
    @TableField(value = "cast_type")
    private String castType;

    /**
     * 抗拉硬度（类型、值）
     */
    @TableField(value = "tensile_hardness")
    private String tensileHardness;

    /**
     * 颈硬度（最小值、最大值、单位）
     */
    @TableField(value = "neck_hardness")
    private String neckHardness;

    /**
     * 芯部重量
     */
    @TableField(value = "weight_in")
    private String weightIn;

    /**
     * 外皮重量
     */
    @TableField(value = "weight_out")
    private String weightOut;

    /**
     * 实测净重
     */
    @TableField(value = "real_weight")
    private String realWeight;

    /**
     * 离心机离心浇注时长
     */
    @TableField(value = "centrifuge_duration")
    private String centrifugeDuration;

    /**
     * 铸造开箱天数
     */
    @TableField(value = "cast_days")
    private Integer castDays;

    /**
     * BOM清单（JSON格式）含外皮、芯部、中间层 中的元素详细
     */
    @TableField(value = "bom_data")
    private String bomData;

    /**
     * 是否已经进行化学分组
     */
    @TableField(exist = false)
    private Integer isPutGroupMap;

    @TableField(exist = false)
    private List<String> bomDataStrList;
    @TableField(exist = false)
    private Map<String, String> bomDataMap;

    /**
     * 最小硬度
     */
    @TableField(exist = false)
    private Integer minHardness;

    /**
     * 最大硬度
     */
    @TableField(exist = false)
    private Integer maxHardness;

    /**
     * 适用模具
     */
    @TableField(exist = false)
    private List<ApsModelInfo> usableModelList;

    /**
     * 是否为打结料
     */
    @TableField(exist = false)
    private String isDaJieFlag;

    /**
     * 加工周期
     */
    @TableField(exist = false)
    private BigDecimal periodDay;

    /**
     * 本月剩余周期
     */
    @TableField(exist = false)
    private Integer residuePeriodDay;
}
